package cn.com.dhcc.turbo.core;

import java.net.*;

public class GetIPFromDomain {
	InetAddress myIPaddress = null;
	InetAddress myServer = null;

	public static void main(String[] args) throws Exception {
		URL url = new URL("http://bbs.csdn.net/topics/390424365");
		System.out.println(getAdress("http://localhost:8087/turbo/account/login.do"));
		System.out.println(getAdress("http://10.1.201.7:8087/turbo/account/login.do"));
		System.out.println("BA99BA10196377E0CB2D2442059ABBDB".equalsIgnoreCase("BA99BA10196377E0CB2D2442059ABBDB"));
	}
	public static String getAdress(String urlStr) throws Exception{
		URL url = new URL(urlStr);
		System.out.println(url.getHost());
		InetAddress address = InetAddress.getByName(url.getHost());
		return address.getHostAddress();
		
	}
}